import torch.nn.functional as F
import torch.optim as optim

from torch.optim.lr_scheduler import StepLR
import torchvision.datasets as datasets
from torchvision import datasets, transforms
import time
transform=transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize((0.1307,), (0.3081,))
        ])
dataset = datasets.ImageFolder('./data/mydata',transform=transform)
print(dataset.classes)  #根据分的文件夹的名字来确定的类别
print(dataset.class_to_idx) #按顺序为这些类别定义索引为0,1...
print(dataset.imgs) #返回从所有文件夹中得到的图片的路径以及其类别
